package com.ecnu.system.domain.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotBlank;

@Data
public class ProReviewDTO {
    @ApiModelProperty(value = "审核id")
    @NotBlank(message = "审核编号不能为空")
    private String id;

    @ApiModelProperty(value = "活动id")
    @NotBlank(message = "活动编号不能为空")
    private String proId;

    @ApiModelProperty(value = "审核状态")
    @NotBlank(message = "审核状态不能为空")
    private String reviewStatus;

    @ApiModelProperty(value = "审核意见")
    private String opinion;

    @AssertTrue(message = "审核状态为驳回时，审核意见不能为空")
    public boolean isRegistrationTimeValid() {
        if ("2".equals(reviewStatus)) {
            return opinion != null ;
        }
        return true;
    }
    @AssertTrue(message = "请检查是否点击审核状态，如果再次出现该信息请联系管理员")
    public boolean isStatusValid() {
        if ("0".equals(reviewStatus)) {
            return opinion != null ;
        }
        return true;
    }
}
